<template>
  <div class="tree-container">
    <!-- 遍历顶层数据，为每个数据项渲染一个 TreeNode -->
    <TreeNode v-for="item in treeData" :key="item.id" :node="item" />
  </div>
</template>

<script setup>
  import TreeNode from './TreeNode.vue'
  const props = defineProps({
    treeData: {
      type: Array,
      required: true,
      default: () => []
    }
  })
</script>

<style scoped>
  .tree-container {
    padding: 10px;
    border: 1px solid #eee;
    border-radius: 4px;
  }
</style>
